var xml2js = require('xml2js')

//导出解析XML的方法
parseXMLAsync = function(xml) {
    return new Promise(function(resolve, reject) {
        xml2js.parseString(xml, { trim: true }, function(err, content) {
            if (err) {
                reject(err);
            } else {
                resolve(content);
            };
        });
    });
};

module.exports = parseXMLAsync